package com.jumper.property.comparer.core.support;


import com.jumper.property.comparer.core.annotations.UniqueKey;
import com.jumper.property.comparer.core.result.User;

import java.util.Set;
import java.util.function.Consumer;
import java.util.function.Function;

/**
 * 批量操作日志管理器
 *
 * @param <T> 查询监听数据主键类型
 */
public interface BatchOptLogManager<K extends UniqueKey<T>, T> {
    /**
     * 批量提交日志
     */
    @Deprecated
    void submit(Set<K> beforeList, Set<K> afterList, String optName, Class<?> cls, User user);

    /**
     * 批量提交日志
     */
    @Deprecated
    void submit(Set<K> beforeList, Set<K> afterList, String optName, Class<?> cls, User user, int batchSaveSize);

    /**
     * 批量提交日志
     */
    @Deprecated
    void submit(Set<T> keys, String optName, Class<?> cls, User user, Runnable runnable);

    /**
     * 批量提交日志
     */
    @Deprecated
    void submit(Set<T> keys, String optName, Class<?> cls, User user, int batchSaveSize, Runnable runnable);

    /**
     * 批量提交日志
     */
    @Deprecated
    <V> V submit(Set<T> keys, String optName, Class<?> cls, User user, Callback<V> runnable);

    /**
     * 批量提交日志
     */
    @Deprecated
    <V> V submit(Set<T> keys, String optName, Class<?> cls, User user, int batchSaveSize, Callback<V> runnable);

    /**
     * 批量提交日志
     */
    void execute(Set<T> keys, String optName, Class<?> cls, User user, Consumer<InTransactionQuery> transactionFunc);

    /**
     * 批量提交日志
     */
    void execute(Set<T> keys, String optName, Class<?> cls, User user, int batchSaveSize, Consumer<InTransactionQuery> transactionFunc);

    /**
     * 批量提交日志
     */
    <V> V submit(Set<T> keys, String optName, Class<?> cls, User user, Function<InTransactionQuery, V> transactionFunc);

    /**
     * 批量提交日志
     */
    <V> V submit(Set<T> keys, String optName, Class<?> cls, User user, int batchSaveSize, Function<InTransactionQuery, V> transactionFunc);
}
